package cn.edu.hpu.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.hpu.dao.ImDao;
import cn.edu.hpu.pojo.Im;
@Transactional
public class ImService {
	private ImDao imDao;

	public void save(Im im){
		imDao.save(im);
		//imDao.getSession().close();
	}
	public void update(Im im){
		imDao.update(im);
		imDao.getSession().close();
	}
	public void delete(String id){
		imDao.del(id);
		//imDao.getSession().close();
	}
	public List<Im> findall(String contactsid){
		return imDao.findBy("contactsid", contactsid);
	}
	@Autowired
	public void setImDao(ImDao imDao) {
		this.imDao = imDao;
	}
	
}
